#include "editer_tab_widget.h"
#include "unitls/globalsignalmgr.h"
#include "ui_editer_tab_widget.h"

editer_tab_widget::editer_tab_widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::editer_tab_widget),
    bar(nullptr)
{

    ui->setupUi(this);
    bar = new editer_bar(ui->fm_text,ui->fm_bar);
}

editer_tab_widget::~editer_tab_widget()
{
    delete ui;
}

void editer_tab_widget::resizeEvent(QResizeEvent *event)
{
//    qInfo("editer resize");
    int all_width = event->size().width();
    int all_height = event->size().height();
    int bar_height = (int) all_width/25;
    int text_height = all_height - bar_height;
    ui->fm_bar->resize(all_width,bar_height);
    ui->fm_text->resize(all_width,text_height);
    ui->fm_bar->move(0,0);
    ui->fm_text->move(0,bar_height);
    if (bar){
        bar->MResize_event(all_width,bar_height);
    }
}
